invoke

abstract fun invoke(args: Array<Any>): Any

Invoked when the corresponding function is called on the JavaScript side.

If the method throws an exception then this exception is also thrown on JavaScript. The exception thrown on JavaScript is a string that consists of the name of the exception, the message, and the first line of the stacktrace (usually it contains the name of the class and method in which the exception occurred).

Return

the function execution result to be returned to the caller on the JavaScript side

Parameters

args

the function arguments converted to Java types